﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

using Boggle;

namespace Boggle.Client
{
	[ValueConversion(typeof(Game.GameState), typeof(String))]
	public class GameStateToStringConverter : IValueConverter
	{
		#region IValueConverter Members

		public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			var gameState = (Game.GameState)value;

			switch (gameState)
			{
				case Game.GameState.Setup:
					return "Game setup";
				case Game.GameState.InProgress:
					return "Game in progress";
				case Game.GameState.Ended:
					return "Game ending...";
				default:
					throw new ArgumentException("value was an unsupported GameState");
			}
		}

		public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			throw new NotImplementedException();
		}

		#endregion
	}
}
